<?php
class Core_Model_Skill_Mapper
	extends Core_Model_Db_Mapper_Abstract
{
	protected $_cacheKeys	= array('Skill');
	
	protected $_table		= 'core_skills';

	public function fetchId(Core_Model_Skill $skill)
	{	
		if (null == $skill->getId())
		{
			throw new Core_Model_Skill_Exception('ID Not Set');
		}
		
		$sql	= $this->getSelect()
					->from($this->_table)
					->where('id = ?', $skill->getId());
					
		$res	= $this->_queryWithCache($sql);
		$this->_mapToSkill($skill, $res[0]);	
	}
	
	protected function _mapToSkill(Core_Model_Skill $skill, $res)
	{
		$skill->setOptions($res);
	}
}